package com.oocl.crm.service;

import com.oocl.crm.command.Command;
import com.oocl.crm.db.CrmUserStore;

/**
 * 业务基类 
 * @author GANAB
 *
 */
public abstract class BusinessService implements IBusinessService<String,Command>{
	/**
	 * 只允许格式为name:abel,sex:1,birthday:20170904……的正则表达式
	 */
	public static final String USER_FIELDS_REGEX = "^(?!,)(id:\\d+|name:[a-zA-Z]+|sex:\\d+|birthday:[0-9]+|address:[a-zA-Z0-9]+|call:[0-9]+|,)*(?<!,)$"; 
	
	/**
	 * 内置数据库DB
	 */
	private CrmUserStore userDB = null;
	
	public BusinessService() {
		this.userDB = CrmUserStore.getInstance();
	}

	/**
	 * 获取用户DB
	 * @return
	 */
	public final CrmUserStore getUserDB() {
		return userDB;
	}

}
